import { createClient } from 'redis';
import Redis from 'ioredis';

// redis-cli操作
const client = createClient({
    socket: {
        host: 'localhost',
        port: 6379
    }
});
client.on('error', err => console.log('Redis Client Error', err));

await client.connect();
const value = await client.keys('*');
console.log(value);

await client.hSet('ahuanTest', '111', '233');
await client.hSet('ahuanTest', '222', '233');
await client.hSet('ahuanTest', '333', '233');
await client.disconnect();



// redis-server操作
const redis = new Redis();
const res = await redis.keys('*');
console.log(111, res)